//partial(可选)
type User={
    id:number,
    name:string
}
type OptUser=Partial<User>
let res:OptUser={
    id:372864
}
console.log("particial:",res)

//required(必选)
type req={
    a?:number
}
type req1=Required<req>
let res2:req1={
    a:32
}
console.log("required:",res2)

//readonly(只读)
type red=Readonly<{x:number}>
let res3:red={
    x:6
}
console.log("readonly:",res3)


//pick<T,K>
type p=Pick<{a:1,b:2,c:3},'a'|'b'>
let res4:p={
    a:1,
    b:2
}
console.log("pick:",res4)

//omit
type p1=Omit<{a:1,b:2,c:3},'a'|'b'>
const res5:p1={
    c:3
}
console.log("omit:",res5)


//extract<T,U>(交集)
type E=Extract<'a'|'b'|'c','a'|'x'>
let res6:E[]=["a"]
console.log("extract:",res6)


//exclude
type p2=Exclude<'a'|'b'|'c','a'>
let res7:p2[]=["b","c"]
console.log("exclude:",res7)


//nonnullable
type N=NonNullable<string|number|null>
let res8:N=32
console.log("nonnullable:",res8)






















